package com.example.androidcompletesec.actionbar;

import android.app.ActionBar;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.widget.Button;

import com.example.androidcompletesec.R;

public class OverlayActionBar extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.overlayactionbar);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.actionbarmenu, menu);
		return true;
	}
	
	public void mOnClick(View v){
		switch (v.getId()) {
		case R.id.btntoggle:
			ActionBar ab = getActionBar();
			if(ab.isShowing()){
				ab.hide();
				((Button)v).setText("Show Action Bar");
			}else{
				ab.show();
				((Button)v).setText("Hide Action Bar");
			}
		}
	}
	
	
}
